#!/bin/bash
echo "start"
pwd
cd helios-server
python3.6 -m venv venv 
source /app/helios-server/venv/bin/activate
python3.6 -m pip install -r requirements.txt --quiet
/etc/init.d/postgresql start
/etc/init.d/rabbitmq-server start

/usr/bin/expect<<EOF
spawn sh -c "sudo -u postgres psql"
expect "postgres#="
send "CREATE ROLE root superuser login;\r"
expect "postgres#="
send "exit;\r"
expect EOF
EOF

./reset.sh
celery -A helios worker
python manage.py runserver 0.0.0.0:8000
